<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>底部固定</title>
<meta name="viewport" content="initial-scale=1, maximum-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
</head>
<style>
html {
height: 100%;
}
body {
min-height: 100%;
margin: 0;
padding: 0;
position: relative;
}
header {
background-color: #ffe4c4;
}
main {
/*box-sizing: border-box;*/
/*height: 1200px;*/
padding-bottom: 100px;
background-color: #ccc;
}
/* main的padding-bottom值要等于或大于footer的height值 */
footer {
opacity: 0.5;
position: absolute;
bottom: 0;
width: 100%;
height: 100px;
background-color: #ffc0cb;
}
</style>
<body>
<header>header</header>
<main>content
<p>asdfasdf</p>
<p>asdfasdf</p>
<p>asdfasdf</p>
</main>
<footer>footer</footer>
</body>
<script>
</script>
<html>
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。